<?php 
namespace Textblast;

require_once '../connect.php';
require_once '../util/validate.php';

class Member {
	
	static function getMemberList($orgID, $limit, $offset) {
		$res = new \stdClass();
		try {
			$res->con = new Connect();
			$res->db = $res->con->open();
			$res->pdo = $res->db->query("select AUID, UserName, Email, FirstName, MiddleName, 
				LastName, CreatedDate from authuser where ORGID = $orgID LIMIT $limit OFFSET $offset;");
			$res->con->close();
		} catch (Exception $e) {
			$res->con->close();
		}

		return $res->pdo;
	}

	static function getMember($id) {
		$res = new \stdClass();
		try {
			$res->con = new Connect();
			$res->db = $res->con->open();
			$res->pdo = $res->db->query("select AUID, UserName, Email, FirstName, MiddleName, 
				LastName, CreatedDate from authuser where AUID = $id;");
			$res->con->close();
		} catch (Exception $e) {
			$res->con->close();
		}

		return $res->pdo;
	}
}
?>